package org.example.config;

import org.example.components.DellDisplayer;
import org.example.components.Printer;
import org.example.factory.DellDisplayerFactoryBean;
import org.example.factory.PrinterFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

@Configuration
@ComponentScan(basePackages = "org.example")
public class AppConfig {
    @Bean
    @Scope("prototype")
    public Printer HPPrinter() {
        return new PrinterFactory().getPrinter("HP");
    }

    @Bean
    @Scope("prototype")
    public Printer epsonPrinter() {
        return new PrinterFactory().getPrinter("Epson");
    }



    @Bean
    public DellDisplayer dellDisplayer() {
        return DellDisplayerFactoryBean.getDellDisplayer();
    }
}
